import org.eclipse.jface.action.*;
import org.eclipse.jface.window.*;
import org.eclipse.swt.*;
import org.eclipse.swt.custom.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;

public class AndroidThemeCreator extends ApplicationWindow
{
  private ExitAction exitAction;
  
  public AndroidThemeCreator()
  {
    super( null );
    
    exitAction = new ExitAction( this );
    
    addMenuBar();
    addToolBar( SWT.FLAT | SWT.WRAP );
    addStatusLine();
  }
  
  protected Control createContents( Composite parent )
  {
    getShell().setText( "Android Theme Creator" );
    parent.setSize( 400, 250 );
    
    parent.setLayout( new GridLayout() );
    SashForm sash = new SashForm( parent, SWT.HORIZONTAL );
    sash.setLayoutData( new GridData( GridData.FILL_BOTH ) );
    sash.setLayout( new FillLayout() );
    
    Tree tree = new Tree( sash, SWT.BORDER );
    TreeItem item = new TreeItem( tree, SWT.NONE );
    item.setText( "Hello, world!" );
    
    Composite container = new Composite( sash, SWT.BORDER );
    container.setLayout( new GridLayout() );
    ( new Label( container, SWT.NONE ) ).setText( "Hello, world!" );
    
    setStatus( "Ready" );
    
    return parent;
  }
  
  protected MenuManager createMenuManager()
  {
    MenuManager menuBar = new MenuManager( "" );
    MenuManager fileMenu = new MenuManager( "&File" );
    MenuManager helpMenu = new MenuManager( "&Help" );
    menuBar.add( fileMenu );
    menuBar.add( helpMenu );
    fileMenu.add( exitAction );
    return menuBar;
  }
  
  protected StatusLineManager createStatusLineManager()
  {
    StatusLineManager slm = new StatusLineManager();
    slm.setMessage( "Ready" );
    return slm;
  }
  
  protected ToolBarManager createToolBarManager( int style )
  {
    ToolBarManager toolBarManager = new ToolBarManager( style );
    toolBarManager.add( exitAction );
    return toolBarManager;
  }
  
  public static void main( String[] args )
  {
    AndroidThemeCreator atc = new AndroidThemeCreator();
    atc.setBlockOnOpen( true );
    atc.open();
    
    Display.getCurrent().dispose();
  }
}